package com.zc.study.designPattern.创建型设计模式.prototypePattern.deepClone;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Test {
    private static Logger logger = LoggerFactory.getLogger(Test.class);
    public static void main(String[] args) {
        WeeklyLog weeklyLog1,weeklyLog2 = null;
        weeklyLog1 = new WeeklyLog();
        Attachment attachment = new Attachment();
        weeklyLog1.setAttachment(attachment);
        try {
            weeklyLog2 = weeklyLog1.deepClone();
        } catch (Exception e) {
            e.printStackTrace();
        }
        logger.debug("weeklyLog 是否是同一对象,{}" ,weeklyLog1 == weeklyLog2);
        logger.debug("attachment 是否是同一个对象,{}",weeklyLog1.getAttachment() == weeklyLog2.getAttachment());
    }
}
